package org.hj.modules.act.actmodel.service.impl;

import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Model;
import org.activiti.engine.repository.ModelQuery;
import org.hj.modules.act.actmodel.mapper.ActModelMapper;
import org.hj.modules.act.actmodel.service.ActModelService;
import org.hj.modules.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author gbw
 * 2020/5/28
 */
@Service
@Transactional //开启事物
public class ActModelServiceImpl implements ActModelService {
    @Autowired
    private ActModelMapper actModelMapper;
    @Autowired
    private RepositoryService repositoryService;

    @Override
    public Map<Object, Object> findById(String id_) {
        return actModelMapper.findById(id_);
    }

    @Override
    public void edit(String category, String id) {
        actModelMapper.edit(category,id);
    }


    @Override
    public List<PageData> getpage(String category, Integer pageNo, Integer pageSize) {
        Integer no=(pageNo-1)*pageSize;
        return actModelMapper.getpage( category,  no,  pageSize);
    }

    @Override
    public int getTotal(String category) {
        return actModelMapper.getTotal(category);
    }

    @Override
    public Map<Object, Object> findActRuTaskById(String id_) {
        return actModelMapper.findActRuTaskById(id_);
    }


}
